package com.gitee.wsl.io.binary

import com.gitee.wsl.ext.array.readDoubleLE
import com.gitee.wsl.ext.array.writeDoubleLE

/**
 * The binary data type for a double.
 */
object DoubleData : BinaryData<Double> {
    override val size: Int = Double.SIZE_BYTES
    override fun parseLE(array: ByteArray, offset: Int): Double {
        return array.readDoubleLE(offset)
        //return LongData.parseLE(array, offset).toDouble()
    }

    override fun storeLE(value: Double, array: ByteArray, offset: Int) {
        array.writeDoubleLE(value, offset)
        //LongData.storeLE(value.toRawBits(), array, offset)
    }
}
